package com.lcke.demo.controller;

import com.lcke.common.rest.PageInfo;
import com.lcke.common.rest.PageUtil;
import com.lcke.common.rest.Result;
import com.lcke.demo.entity.Notice;
import com.lcke.demo.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("notice")
public class NoticeController {

    @Autowired
    private NoticeService noticeService;

    @RequestMapping("page")
    public PageInfo<Notice> page(Notice param) {
        List<Notice> result = noticeService.list(param);
        return PageUtil.page(result);
    }

    @RequestMapping("date")
    public Result date(Date param) {
        return Result.okData(param);
    }


}
